package com.ys.cloudpicture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ys.cloudpicture.model.dto.picture.PictureQueryRequest;
import com.ys.cloudpicture.model.dto.picture.PictureReviewRequest;
import com.ys.cloudpicture.model.dto.picture.PictureUploadByBatchRequest;
import com.ys.cloudpicture.model.dto.picture.PictureUploadRequest;
import com.ys.cloudpicture.model.entity.Picture;
import com.ys.cloudpicture.model.vo.PictureVO;
import com.ys.cloudpicture.model.vo.UserLoginVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author YS
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-02-07 14:29:18
*/
public interface PictureService extends IService<Picture> {
    /**
     * 上传图片
     *
     * @param inputSource
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            UserLoginVO loginUser);

    /**
     * 获取查询条件
     *
     * @param pictureQueryRequest
     * @return
     */
    public QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest) ;

    /**
     * 获取单个图片
     * @param picture
     * @param request
     * @return
     */
    public PictureVO getPictureVO(Picture picture, HttpServletRequest request) ;

    /**
     * 分页获取图片封装
     */
    public Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request) ;


    /**
     * 校验图片
     * @param picture
     */
    void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, UserLoginVO loginUser);

    void fillReviewParams(Picture picture, UserLoginVO loginUser);

    /**
     * 批量上传图片
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, UserLoginVO loginUser);
}
